// MySocket.cpp: implementation of the MySocket class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "RenjuGame.h"
#include "MySocket.h"
#include "RenjuGameDlg.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

MySocket::MySocket()
{

}

MySocket::~MySocket()
{

}

void MySocket::OnReceive(int nErrorCode)
{
	m_dlg->OnReceive();
	CSocket::OnReceive(nErrorCode);
}

void MySocket::OnAccept(int nErrorCode)
{
	if(m_dlg->m_ClientSocket == NULL)
		m_dlg->OnAccept();
	CSocket::OnAccept(nErrorCode);
}

void MySocket::OnClose(int nErrorCode)
{
	m_dlg->OnClose();
	CSocket::OnClose(nErrorCode);
}

void MySocket::GetDlg(CRenjuGameDlg *dlg)
{
	m_dlg = dlg;
}
